<?php session_start(); if($_SESSION['properlogin'] != 1){ header("Location:error.html"); }?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Payment</title>
<script type="text/javascript" src="validateInformation.js" ></script>


<?php
if(isset($_POST['Done']))
{
	$snum=$_POST['studNum1'].$_POST['studNum2'];
	$pterm=$_POST['paymentTerm'];
	
	$pporno=$_POST['paymentOrno'];
	$df=$_POST['dormFee'];
	$af=$_POST['appFee'];
	$tf=$_POST['transFee'];
	$remarks=$_POST['remarks'];
	
	if(intval($_POST['payYear1'])==intval($_POST['payYear2'])){
	$result=intval($_POST['payMonth2'])-intval($_POST['payMonth1']);
	}else if(intval($_POST['payYear1'])<intval($_POST['payYear2'])){
	$result=12-(intval($_POST['payMonth1'])-intval($_POST['payMonth2']));
	}
	
	if(intval($_POST['payMonth1'])==1){
		$month1="JANUARY";
	}else if(intval($_POST['payMonth1'])==2){
		$month1="FEBRUARY";
	}else if(intval($_POST['payMonth1'])==3){
		$month1="MARCH";
	}else if(intval($_POST['payMonth1'])==4){
		$month1="APRIL";
	}else if(intval($_POST['payMonth1'])==5){
		$month1="MAY";
	}else if(intval($_POST['payMonth1'])==6){
		$month1="JUNE";
	}else if(intval($_POST['payMonth1'])==7){
		$month1="JULY";
	}else if(intval($_POST['payMonth1'])==8){
		$month1="AUGUST";
	}else if(intval($_POST['payMonth1'])==9){
		$month1="SEPTEMBER";
	}else if(intval($_POST['payMonth1'])==10){
		$month1="OCTOBER";
	}else if(intval($_POST['payMonth1'])==11){
		$month1="NOVEMBER";
	}else if(intval($_POST['payMonth1'])==12){
		$month1="DECEMBER";
	}
	
	if(intval($_POST['payMonth2'])==1){
		$month2="JANUARY";
	}else if(intval($_POST['payMonth2'])==2){
		$month2="FEBRUARY";
	}else if(intval($_POST['payMonth2'])==3){
		$month2="MARCH";
	}else if(intval($_POST['payMonth2'])==4){
		$month2="APRIL";
	}else if(intval($_POST['payMonth2'])==5){
		$month2="MAY";
	}else if(intval($_POST['payMonth2'])==6){
		$month2="JUNE";
	}else if(intval($_POST['payMonth2'])==7){
		$month2="JULY";
	}else if(intval($_POST['payMonth2'])==8){
		$month2="AUGUST";
	}else if(intval($_POST['payMonth2'])==9){
		$month2="SEPTEMBER";
	}else if(intval($_POST['payMonth2'])==10){
		$month2="OCTOBER";
	}else if(intval($_POST['payMonth2'])==11){
		$month2="NOVEMBER";
	}else if(intval($_POST['payMonth2'])==12){
		$month2="DECEMBER";
	}
	
	$duration=$month1." ".$_POST['payYear1']." to ".$month2." ".$_POST['payYear2'];
	$term=$result;
	$paydate=$_POST['paymentDate'].$_POST['appMonth'].$_POST['appYear'];
	$_SESSION['snum']=$snum;
	$_SESSION['pterm']=$pterm;
	$_SESSION['term']=$term;
	$_SESSION['pporno']=$pporno;
	$_SESSION['paydate']=$paydate;
	$_SESSION['df']=$df;
	$_SESSION['af']=$af;
	$_SESSION['tf']=$tf;
	$_SESSION['remarks']=$remarks;
	$_SESSION['duration']=$duration;
	header("Location:paymentForm.php");
}

?>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="100%" border="0" cellpadding="1">
 
  <tr>
    <td>&nbsp;</td>
    <td class="subBanner"><strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add Resident Payment </strong></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><form id="form1" name="form1" method="post" action="" onsubmit="return validateInformation8(this)">
      <table width="100%" border="0" cellpadding="1">
        <tr>
          <td>&nbsp;</td>
          <td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong>&nbsp;</td>
          <td id="lname2" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Student Number</td>
          <td><strong>
            <input name="studNum1" type="text" id="studNum1" size="3" />
            -
  <input name="studNum2" type="text" id="studNum2" size="7" />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong>&nbsp;</td>
          <td id="snum" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td width="37%"><strong>Term</strong></td>
          <td width="34%"><strong>
            <input type="radio" name="paymentTerm"  value="first" />
First Semester
<input type="radio" name="paymentTerm" value="second" />
Second Semester
<input type="radio" name="paymentTerm" value="summer" />
Summer</strong></td>
          <td width="29%" id="pterm" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td height="67">Period Covered</td>
          <td><strong>
            <select name="payMonth1">
              <option selected="selected" value="1">January</option>
              <option value="2">February</option>
              <option value="3">March</option>
              <option value="4">April</option>
              <option value="5">May</option>
              <option value="6">June</option>
              <option value="7">July</option>
              <option value="8">August</option>
              <option value="9">September</option>
              <option value="10">October</option>
              <option value="11">November</option>
              <option value="12">December</option>
            </select>
            <select name="payYear1" >
			  <option value="2008">2008</option>
              <option value="2009">2009</option>
              <option value="2010">2010</option>
              <option value="2011">2011</option>
              <option value="2012">2012</option>
              <option value="2013">2013</option>
              <option value="2014">2014</option>
            </select>
            to 
            <select name="payMonth2">
              <option selected="selected" value="1">January</option>
              <option value="2">February</option>
              <option value="3">March</option>
              <option value="4">April</option>
              <option value="5">May</option>
              <option value="6">June</option>
              <option value="7">July</option>
              <option value="8">August</option>
              <option value="9">September</option>
              <option value="10">October</option>
              <option value="11">November</option>
              <option value="12">December</option>
            </select>
            
            <select name="payYear2" >
              <option value="2008">2008</option>
              <option value="2009">2009</option>
              <option value="2010">2010</option>
              <option value="2011">2011</option>
              <option value="2012">2012</option>
              <option value="2013">2013</option>
              <option value="2014">2014</option>
            </select>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;          </strong></td>
          <td id="covered" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Receipt Number</td>
          <td><strong>
            <input name="paymentOrno" type="text"   size="40" maxlength="7"/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;            </strong></td>
          <td id="pporno" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Dorm Fee</td>
          <td><strong>
            <input name="dormFee" type="text"   size="40" />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong></td>
          <td id="df" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Appliance Fee</td>
          <td><strong>
            <input name="appFee" type="text"   size="40" />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong></td>
          <td id="af" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Transient Fee</td>
          <td><strong>
            <input name="transFee" type="text"   size="40" />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong></td>
          <td id="tf" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Date Paid</td>
          <td><select name="appMonth" id="bdMonth">
            <option selected="selected" value="JAN">January</option>
            <option value="FEB">February</option>
            <option value="MAR">March</option>
            <option value="APR">April</option>
            <option value="MAY">May</option>
            <option value="JUN">June</option>
            <option value="JUL">July</option>
            <option value="AUG">August</option>
            <option value="SEP">September</option>
            <option value="OCT">October</option>
            <option value="NOV">November</option>
            <option value="DEC">December</option>
          </select>
&nbsp;
<select name="paymentDate" id="paymentDate">
           <option selected="selected" value="01">1</option>
              <option value="02">2</option>
              <option value="03">3</option>
              <option value="04">4</option>
              <option value="05">5</option>
              <option value="06">6</option>
              <option value="07">7</option>
              <option value="08">8</option>
              <option value="09">9</option>
              <option value="10">10</option>
			  <option value="11">11</option>
              <option value="12">12</option>
              <option value="13">13</option>
              <option value="14">14</option>
              <option value="15">15</option>
              <option value="16">16</option>
              <option value="17">17</option>
              <option value="18">18</option>
              <option value="19">19</option>
			  <option value="20">20</option>
              <option value="21">21</option>
              <option value="22">22</option>
              <option value="23">23</option>
              <option value="24">24</option>
              <option value="25">25</option>
              <option value="26">26</option>
              <option value="27">27</option>
              <option value="28">28</option>
			  <option value="29">29</option>
              <option value="30">30</option>
              <option value="31">31</option>

          </select>

&nbsp;

<select name="appYear" >
  
  <option value="2008">2008</option>
  <option value="2009">2009</option>
  <option value="2010">2010</option>
  <option value="2011">2011</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td id="paydate" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Remarks</td>
          <td><textarea name="remarks" cols="35" rows="4"></textarea>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="submit" name="Done" id="Done" value="Done" /></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td></td>
          <td>&nbsp;</td>
        </tr>
      </table>
    </form></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
